package com.crm.service.Impl;

import com.crm.mapper.userMapper;
import com.crm.pojo.User;
import com.crm.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class userServiceImpl implements userService {
    @Autowired
    private userMapper mapper;
    @Override
    public boolean login(User user) {
        User u = mapper.selectByUserAndPwd(user);
        if(u==null){
            return false;
        }
        return true;
    }

    @Override
    public boolean register(User user) {
        return mapper.addOne(user);
    }

    @Override
    public User selectByTel(User user) {
        return mapper.selectByTel(user);
    }

    @Override
    public boolean updateUser(User user) {
        return mapper.updateUser(user);
    }
}
